Skip to content

CCM-17379: Persist supplier config#582

Open
stevebux wants to merge 2 commits into
feature/CCM-17343-Route-Supplier-Configfrom
feature/CCM-17379-Persist-Supplier-Config
Open

CCM-17379: Persist supplier config#582
stevebux wants to merge 2 commits into
feature/CCM-17343-Route-Supplier-Configfrom
feature/CCM-17379-Persist-Supplier-Config

Conversation

@stevebux
Copy link
Copy Markdown
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

DT3-Specific Checklist

  • If I have added a new resource (SQS, Lambda, Gateway, DDB table, etc), I have created the appropriate alarms

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@stevebux stevebux requested review from a team as code owners May 18, 2026 14:12
@stevebux stevebux force-pushed the feature/CCM-17379-Persist-Supplier-Config branch from 02c123c to 5db0da2 Compare May 19, 2026 08:54
@stevebux stevebux requested a review from Copilot May 20, 2026 10:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an event-ingestion path to persist supplier-configuration events into the Supplier Configuration DynamoDB table, by introducing a new supplier-config-ingress Lambda triggered from an EventSub SNS → SQS subscription, and extending the internal datastore with an upsert API.

Changes:

  • Introduces lambdas/supplier-config-ingress to consume SQS messages and upsert supplier config entities, emitting EMF metrics.
  • Extends @internal/datastore with SupplierConfigEntity typing and upsertSupplierConfig() plus associated tests.
  • Adds Terraform resources for the new SQS queue, SNS subscription filtering, Lambda module wiring, event source mapping, and alarm targeting.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package-lock.json Adds workspace deps for the new supplier-config-ingress lambda (but currently contains an inconsistent zod resolution).
lambdas/supplier-config-ingress/tsconfig.json TypeScript config for the new lambda package.
lambdas/supplier-config-ingress/src/index.ts Exposes the Lambda handler entrypoint.
lambdas/supplier-config-ingress/src/handler/supplier-config-ingress-handler.ts Implements SQS batch processing, schema validation, upsert calls, and EMF metric emission.
lambdas/supplier-config-ingress/src/config/env.ts Defines required env vars for the lambda.
lambdas/supplier-config-ingress/src/config/deps.ts Wires logger + DynamoDB document client + repository dependencies.
lambdas/supplier-config-ingress/src/tests/supplier-config-ingress-handler.test.ts Unit tests for record parsing, failure reporting, and metrics emission.
lambdas/supplier-config-ingress/package.json New lambda workspace package definition and scripts.
lambdas/supplier-config-ingress/jest.config.ts Jest config aligned with other lambdas.
lambdas/supplier-config-ingress/.gitignore Ignores build/test artifacts for the new lambda.
lambdas/supplier-allocator/src/handler/tests/allocate-handler.test.ts Cleans up unused repo mocks in tests.
internal/datastore/src/types.ts Adds SupplierConfigEntity enum/type for supplier-config entities.
internal/datastore/src/supplier-config-repository.ts Adds upsertSupplierConfig() and helper update-expression builders.
internal/datastore/src/test/supplier-config-repository.test.ts Refactors and expands repository tests; adds upsert coverage across entities.
infrastructure/terraform/components/api/sns_topic_subscription_eventsub_sqs_supplier_config.tf Creates SNS→SQS subscription with message-body filter for supplier-config events.
infrastructure/terraform/components/api/README.md Documents the new SQS/Lambda modules in the component README.
infrastructure/terraform/components/api/module_sqs_supplier_config.tf Provisions new supplier-config SQS queue (+ DLQ) and SNS send policy.
infrastructure/terraform/components/api/module_lambda_supplier_config_ingress.tf Provisions new lambda and IAM permissions for SQS read + DynamoDB update.
infrastructure/terraform/components/api/locals_alarms.tf Registers new lambda + SQS queue for the alarms modules.
infrastructure/terraform/components/api/lambda_event_source_mapping_supplier_config_ingress.tf Connects SQS queue to lambda with partial batch failure reporting enabled.
.github/scripts/dispatch_internal_repo_workflow.sh Fixes a bash conditional syntax error.

Comment thread lambdas/supplier-config-ingress/src/handler/supplier-config-ingress-handler.ts Outdated
Comment thread internal/datastore/src/supplier-config-repository.ts Outdated
Comment thread internal/datastore/src/supplier-config-repository.ts Outdated
@stevebux stevebux changed the base branch from main to feature/CCM-17343-Route-Supplier-Config May 20, 2026 13:15
@stevebux stevebux force-pushed the feature/CCM-17379-Persist-Supplier-Config branch from 99fe0d7 to e8b19d2 Compare May 20, 2026 13:23
@stevebux stevebux force-pushed the feature/CCM-17343-Route-Supplier-Config branch from d4457f8 to 89ea5d8 Compare May 20, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants